<include file="Public:header" />
<!--主体内容-->
<!--左边-->
<div class="centent_box">
    <include file="Public:left" />
    <!--右边-->
    <div class="centent_right_box">
        <div class="centent_right rightCon">
            <div class="Mtitle">
                <ul>
                    <li class="on"><span>房源管理</span></li>
                </ul>
                <div class="rightWord"><a href="{:U('used/add')}">新增房源</a> &gt;&gt; 数据录入</div>
            </div>
            <form id="info_form" action="{:U('Used/edit')}" method="post" enctype="multipart/form-data">
                <div class="con_div">
                    <ul class="formList width2 list_ul list_mp">
                        <li>
                            <label>房源属性：</label>
                            <select class="selectStyle" name="data[sell_type]" id="sell_type">
                                <option value="1" <if condition="$info['sell_type'] eq 1">selected</if> >出售</option>
                                <option value="2" <if condition="$info['sell_type'] eq 2">selected</if> >出租</option>
                                <option value="3" <if condition="$info['sell_type'] eq 3">selected</if> >租售</option>
                            </select>
                        </li>
                        <li>
                            <label>房源名称：</label>
                            <input type="text"  name="data[title]" class="inputStyle width3" value="{$info.title}" readonly>
                            <input type="hidden"  name="id" value="{$info.id}" >
                            <input type="hidden"  name="data[dict_id]" value="{$info.dict_id}" >
                        </li>
                        <li>
                            <label>房源编码：</label>
                            <input type="text"  name="data[encoded]" id="encoded" class="inputStyle width3" value="{$info.encoded}" >
                        </li>
                        <li>
                            <label>楼栋：</label>
                            <input type="text"  name="build[alias]"  class="inputStyle width5" value="{$dict.balias}" data="{$dict.balias}">
                            <input type="hidden"  name="build[bid]" value="{$dict.bid}">
                            <if condition="$unit_count gt 1">
                                <label>单元：</label>
                                <input type="text"  name="unit[alias]" class="inputStyle width5" value="{$dict.ualias}" data="{$dict.ualias}">
                            </if>
                            <input type="hidden"  name="unit[unid]" value="{$dict.unid}">
                            <label>楼层：</label>
                            <input type="text"  name="room[f_alias]" class="inputStyle width5" value="{$dict.f_alias}" data="{$dict.f_alias}">
                            <label>门牌：</label>
                            <input type="text"  name="room[alias]" class="inputStyle width5" value="{$dict.alias}" data="{$dict.alias}">
                            <span class="tip">（房号：<em id="roomno">{$dict.f_alias}{$dict.alias}</em>）</span>
                            <input type="hidden"  name="room[rid]" value="{$dict.rid}">
                            <input type="hidden"  name="room[floor]" value="{$dict.floor}">
                        </li>
                        <li>
                            <label>选择户型：</label>
                            <input type="number"  name="chamber" value="{$info.chamber}" class="inputStyle used_type" style="width: 50px" min="0" max="100" >
                            <span class="tip">室</span>
                            <input type="number"  name="hall" value="{$info.hall}" class="inputStyle used_type" style="width: 50px" min="0" max="100" value="0">
                            <span class="tip">厅</span>
                            <input type="number"  name="toilet" value="{$info.toilet}" class="inputStyle used_type" style="width: 50px" min="0" max="5" value="0">
                            <span class="tip">卫</span>
                            <input type="number"  name="kitchen" value="{$info.kitchen}" class="inputStyle used_type" style="width: 50px" min="0" max="5" value="0">
                            <span class="tip">厨</span>
                            <input type="number"  name="balcony" value="{$info.balcony}" data="{$info.balcony}" class="inputStyle used_type" style="width: 50px" min="0" max="5" >
                            <span class="tip">阳台</span>
                        </li>
                        <li class="dict-info">
                            <label>面积：</label>
                            <input type="text" class="inputStyle width2 required" name="room[area]" value="{$info.area}" id="proportion" >
                            <span class="tip">平方米</span>

                        </li>
                        <li id="li-total" <if condition="$info['sell_type'] neq 1 and $info['sell_type'] neq 3">style="display:none"</if>>
                        <label>总价：</label>
                        <input type="text" class="inputStyle width2 required" name="data[total_price]" id="total" value="{$info.total_price}">
                        <span class="tip">万/平方米</span>
                        <label class="label1">均价：</label>
                        <input type="text" class="inputStyle width2" name="data[average_price]"  value="{$info.average_price}" id="average" readonly>
                        <span class="tip">万/平方米</span>
                        </li>
                        <li id="li-rental" <if condition="$info['sell_type'] neq 2 and $info['sell_type'] neq 3">style="display:none"</if>>
                        <label>租金：</label>
                        <input type="text" class="inputStyle width2 required" name="data[rental_price]" id="rental" value="{$info.rental_price}">
                        <span class="tip">元/平方米</span>
                        </li>
                        <li id="contacts">
                            <label>联系人 ：</label>
                            <input type="text" class="inputStyle width1 required" name="data[contacts]" value="{$info.contacts}">
                            <span class="tip">必填项</span>
                        </li>
                        <li>
                            <label>联系电话：</label>
                            <input type="text" class="inputStyle" name="data[phone]" value="{$info.phone}">
                            <span class="tip">必填项</span>
                        </li>
                        <li id="phone-other">
                            <label>其它电话：</label>
                            <input type="text" class="inputStyle" name="data[phone1]" style="width:150px;margin-right: 20px" id="phone1">
                            <input type="text" class="inputStyle" name="data[phone2]" style="width:150px;margin-right: 20px" id="phone2">
                            <input type="text" class="inputStyle" name="data[phone3]" style="width:150px;margin-right: 20px" id="phone3">
                        </li>
                        <li class="li_radio">
                            <label class="lw90">朝向：</label>
                            <input type="radio" name="room[aspect]" id="orientations109" value="10" <if condition="$info['aspect'] eq 10">checked</if> >
                            <label for="orientations109">西北</label>
                            <input type="radio" name="room[aspect]" id="orientations108" value="9" <if condition="$info['aspect'] eq 9">checked</if> >
                            <label for="orientations108">西南</label>
                            <input type="radio" name="room[aspect]" id="orientations107" value="8" <if condition="$info['aspect'] eq 8">checked</if> >
                            <label for="orientations107">东北</label>
                            <input type="radio" name="room[aspect]" id="orientations106" value="7" <if condition="$info['aspect'] eq 7">checked</if> >
                            <label for="orientations106">东南</label>
                            <input type="radio" name="room[aspect]" id="orientations105" value="6" <if condition="$info['aspect'] eq 6">checked</if> >
                            <label for="orientations105">南北</label>
                            <input type="radio" name="room[aspect]" id="orientations104" value="5" <if condition="$info['aspect'] eq 5">checked</if> >
                            <label for="orientations104">东西</label>
                            <input type="radio" name="room[aspect]" id="orientations103" value="4" <if condition="$info['aspect'] eq 4">checked</if> >
                            <label for="orientations103">北</label>
                            <input type="radio" name="room[aspect]" id="orientations102" value="3" <if condition="$info['aspect'] eq 3">checked</if> >
                            <label for="orientations102">南</label>
                            <input type="radio" name="room[aspect]" id="orientations101" value="2" <if condition="$info['aspect'] eq 2">checked</if> >
                            <label for="orientations101">西</label>
                            <input type="radio" name="room[aspect]" id="orientations100" value="1" <if condition="$info['aspect'] eq 1">checked</if> >
                            <label for="orientations100">东</label>
                        </li>
                        <li class="li_checkbox" id="mating">
                            <label class="lw90">房屋配套：</label>
                            <input type="checkbox" name="mating[]" id="mating1" value="1" <if condition="in_array ('1',$info['mating'])">checked</if> ><label for="mating1">冰箱</label>
                            <input type="checkbox" name="mating[]" id="mating2" value="2" <if condition="in_array ('2',$info['mating'])">checked</if> ><label for="mating2">床</label>
                            <input type="checkbox" name="mating[]" id="mating3" value="3" <if condition="in_array ('3',$info['mating'])">checked</if> ><label for="mating3">衣橱</label>
                            <input type="checkbox" name="mating[]" id="mating4" value="4" <if condition="in_array ('4',$info['mating'])">checked</if> ><label for="mating4">热水器</label>
                            <input type="checkbox" name="mating[]" id="mating5" value="5" <if condition="in_array ('5',$info['mating'])">checked</if> ><label for="mating5">沙发</label>
                            <input type="checkbox" name="mating[]" id="mating6" value="6" <if condition="in_array ('6',$info['mating'])">checked</if> ><label for="mating6">电视</label>
                            <input type="checkbox" name="mating[]" id="mating7" value="7" <if condition="in_array ('7',$info['mating'])">checked</if> ><label for="mating7">网络</label>
                            <input type="checkbox" name="mating[]" id="mating8" value="8" <if condition="in_array ('8',$info['mating'])">checked</if> ><label for="mating8">家电齐全</label>
                            <input type="checkbox" name="mating[]" id="mating9" value="9" <if condition="in_array ('9',$info['mating'])">checked</if> ><label for="mating9">家私齐全</label>
                        </li>
                        <if condition="$info['img'] neq null">
                            <li style="height: 52px" id="used-type">
                                <label>户型图：</label>
                                <div style="display:inline-table;width: 200px;height: 200px">
                                    <img src="{$info.img}" width="50px" height="50px"/>
                                </div>
                                <button onclick="alter (this)">修改</button>
                            </li>

                            <else />
                            <li>
                                <label>户型图：</label>
                                <input type="file" name="img" id="img">
                            </li>

                        </if>
                        <li>
                            <label>产权：</label>
                            <select name="data[property]" id="property" class="selectStyle">
                                <option value="0" selected>请选择</option>
                                <option value="15" <if condition="$info['property'] eq 15">selected</if> >红本五年一套</option>
                                <option value="16" <if condition="$info['property'] eq 16">selected</if> >红本两年多套</option>
                                <option value="17" <if condition="$info['property'] eq 17">selected</if> >贷款五年一套</option>
                                <option value="18" <if condition="$info['property'] eq 18">selected</if> >贷款两年多套</option>
                                <option value="19" <if condition="$info['property'] eq 19">selected</if> >贷款不满两年</option>
                                <option value="21" <if condition="$info['property'] eq 21">selected</if> >红本不满两年</option>
                                <option value="12" <if condition="$info['property'] eq 12">selected</if> >红本在手</option>
                            </select>
                            <label>用途：</label>
                            <select name="data[purpose]" id="purpose" class="selectStyle">
                                <option value="0">请选择</option>
                                <option value="1" <if condition="$info['purpose'] eq 1">selected</if>>住宅</option>
                                <option value="2" <if condition="$info['purpose'] eq 2">selected</if>>写字楼</option>
                                <option value="3" <if condition="$info['purpose'] eq 3">selected</if>>商铺</option>
                                <option value="4" <if condition="$info['purpose'] eq 4">selected</if>>商务公寓</option>
                                <option value="5" <if condition="$info['purpose'] eq 5">selected</if>>厂房</option>
                            </select>
                        </li>
                        <li>
                            <label>钥匙人 ：</label>
                            <select name="data[keyer]" id="keyer" class="selectStyle">
                                <option value="">请选择</option>
                                <volist name="users" id="vo">
                                    <option value="{$vo.id}" {$vo.key_sele}>{$vo.username}</option>
                                </volist>
                            </select>
                            <label>钥匙编号 ：</label>
                            <input type="text" class="inputStyle width1" name="data[keyno]" value="{$info.keyno}">
                        </li>
                        <li>
                            <label>维护人 ：</label>
                            <input type="text" class="inputStyle width2" name="maintain" value="{$maintain}" id="maintain" readonly>
                            <button onclick="grab ({$info.id},{$info.user_id},'{$info.add_time}')" style="width:60px;height: 32px;margin-left: 30px">抢 回</button>
                        </li>

                        <if condition="$info['files'] eq null">
                            <li id="files">
                                <label>室内图：</label>
                                <script id="uploadpic" name="uploadpic" type="text/plain"></script>
                                <input type="button" class="btn btn_submit" style="margin:0 0 10px 10px;" onclick="upImage();" value="选择图片">
                                <div id="imageList">
                                    <ul class="list clearfix"></ul>
                                </div>
                                <input type="hidden" name="file" id="file" />
                            </li>
                            <else/>
                            <li style="height: 52px" id="m_img">
                                <label>室内图：</label>
                                <div style="display:inline-table;height: 200px" class="clear">
                                    <volist name="info['files']" id="vo">
                                        <span><img src="{$vo->img}" width="50px" height="50px" style="margin-right: 10px"/></span>
                                    </volist>
                                </div>
                            </li>
                            <li id="files">
                                <label>上传室内图：</label>
                                <script id="uploadpic" name="uploadpic" type="text/plain"></script>
                                <input type="button" class="btn btn_submit" style="margin:0 0 10px 10px;" onclick="upImage();" value="选择图片">
                                <div id="imageList">
                                    <ul class="list clearfix"></ul>
                                </div>
                                <input type="hidden" name="file" id="file" />
                            </li>
                        </if>

                        <li class="li_radio">
                            <label class="lw90">装修情况：</label>
                            <input type="radio" name="data[decorate]" id="renovation_type70" value="4" <if condition="$info['decorate'] eq 4">checked</if> ><label for="renovation_type70">豪装</label>
                            <input type="radio" name="data[decorate]" id="renovation_type68" value="3" <if condition="$info['decorate'] eq 3">checked</if> ><label for="renovation_type68">精装</label>
                            <input type="radio" name="data[decorate]" id="renovation_type67" value="2" <if condition="$info['decorate'] eq 2">checked</if> ><label for="renovation_type67">简装</label>
                            <input type="radio" name="data[decorate]" id="renovation_type69" value="1" <if condition="$info['decorate'] eq 1">checked</if> ><label for="renovation_type69">毛坯</label>
                        </li>
                        <li>
                            <label>建筑年代：</label>
                            <input type="text" class="inputStyle width2" name="data[years]" value="{$info.years}" id="years" readonly>
                            <span class="tip">年</span>
                        </li>
                        <li>
                            <label>所在地址：</label>
                            <input type="text" class="inputStyle width3" name="data[address]" value="{$info.address}" id="addr" readonly>
                            <span class="tip">中文字符</span>
                        </li>
                        <li>
                            <label>地图标注：</label>
                            <input type="text" class="inputStyle" name="data[map]" id="map" value="{$info.map}" readonly>
                        </li>

                        <li class="height2">
                            <label>详细介绍：</label>
                            <textarea name="data[info]" id="info" style="width:100%;height:300px;resize: none;float:left">{$info.info}</textarea>
                        </li>
                        <input type="hidden"  name="data[img]" id="img-url">
                        <li>
                            <button class="btnStyle" onclick="history.go(-1)">返回</button>
                            <button class="btnStyle" style="background-color: green" onclick="exam({$info.id},'pass')">审核通过</button>
                            <button class="btnStyle" style="background-color: blue" onclick="exam({$info.id},'nopass')">审核不通过</button>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    function exam (id,sig){
        event.preventDefault();
        window.event.returnValue;
        var title = '';
        if (sig == 'pass'){
            title = '通过？';
        }else {
            title = '不通过？';
        }
        layer.confirm(title, {
            btn: ['是','否'] //按钮
        }, function(){
            var url = "{:U('Ajax/examine')}";
            var data = {id:id,sig:sig};
            $.post (url, data, function (respose){
                if (respose.state == 'ok'){
                    layer.msg('操作成功', {icon: 1});
                    self.location=document.referrer;
                }else{
                    layer.msg('网络出错', {icon: 0});
                }
            },'json');
        }, function(){
            layer.msg('操作失败', {icon: 0});
        });
    }

</script>
<include file="Public:footer" />